package com.example.bigevent.anno;

import com.example.bigevent.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.reflect.Field;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Documented
@Constraint(validatedBy = {StateValidation.class})
@Target({ElementType.FIELD})
@Retention(RUNTIME)
public @interface State {
    String message() default "state参数的值只能数已发布或者草稿";
    //指定分组
    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
